<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		$this->user_auth->manage();

		$this->load->model('category_model');
		$this->load->model('book_model');

		$this->menu_view = $this->menu_lib->get(0);

		$this->data = array();
	}

	public function index()
	{
		//$data = array(
		//	'content' => $this->flat_app->get('index.php')
		//);
		//$this->load->view('template', $data);
		/* codigo de vista*/
		$data = array(
			'qty_books' => $this->book_model->get()->num_rows(),
			'qty_categories' => $this->category_model->get()->num_rows()
		);

		$include_view = $this->load->view('home',$data, TRUE);
		$this->load->view('template', array('content' => $this->menu_view . $include_view));
	}

}

/* End of file home.php */
/* Location: ./application/controllers/home.php */
